package com.eastfair.venueservice.service;

import com.eastfair.boot.service.SuperService;
import com.eastfair.venueservice.dto.ServiceProviderUserDTO;
import com.eastfair.venueservice.entity.ServiceProviderUser;
import com.eastfair.venueservice.vo.ServiceProviderUserVO;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 服务商用户关系
 * </p>
 *
 * @author dqq
 * @date 2023-02-02
 */
public interface ServiceProviderUserService extends SuperService<ServiceProviderUser> {

    /**
     * 查询服务商用户关系列表.
     *
     * @param serviceProviderUserDTO the service provider user dto
     * @return the list
     */
    List<ServiceProviderUser> listServiceProviderUser(ServiceProviderUserDTO serviceProviderUserDTO);

    /**
     * 用户ID批量获取服务商用户关系.
     *
     * @param userIdList              the user id
     * @param serviceProviderId   the service provider id
     * @param serviceProviderType the service provider type
     * @return the list
     */
    List<ServiceProviderUserVO> listVOByIds(List<Long> userIdList, Long serviceProviderId, String serviceProviderType);

    /**
     * 获取服务商的主用户.
     *
     * @param serviceProviderId   the service provider id
     * @param serviceProviderType the service provider type
     * @return the main account user
     */
    ServiceProviderUser getMainAccountUser(Long serviceProviderId, String serviceProviderType);

    /**
     * 用户ID, 服务商类型查询绑定的服务商.
     *
     * @param userId              the user id
     * @param serviceProviderType the service provider type
     * @return the by user id
     */
    ServiceProviderUser getByUserId(Long userId, String serviceProviderType);

    /**
     * 获取主用户注册的第一个服务商关系.
     *
     * @param userId the user id
     * @return the first register main by user id
     */
    ServiceProviderUser getFirstRegisterMainByUserId(Long userId);

    /**
     * 服务商用户关系是否存在.
     *
     * @param userId              the user id
     * @param serviceProviderId   the service provider id
     * @param serviceProviderType the service provider type
     * @return the boolean
     */
    boolean existServiceProviderUser(Long userId, Long serviceProviderId, String serviceProviderType);

    /**
     * 保存服务商，用户关系.
     *
     * @param serviceProviderUserDTO the service provider user dto
     * @return the boolean
     */
    boolean saveServiceProviderUser(ServiceProviderUserDTO serviceProviderUserDTO);

    /**
     * 服务商ID移除服务商关系.
     *
     * @param serviceProviderId the service provider id
     * @return the boolean
     */
    boolean removeByServiceProviderId(Long serviceProviderId);

    /**
     * 用户ID移除服务商关系.
     *
     * @param userId the user id
     * @return the boolean
     */
    boolean removeByUserId(Long userId);

    /**
     * 移除用户，服务商关系.
     *
     * @param userId              the user id
     * @param serviceProviderId   the service provider id
     * @param serviceProviderType the service provider type
     * @return the boolean
     */
    boolean removeServiceProviderUser(Long userId, Long serviceProviderId, String serviceProviderType);

    /**
     * 批量移除用户，服务商关系.
     *
     * @param userId              the user id
     * @param serviceProviderId   the service provider id
     * @param serviceProviderType the service provider type
     * @return the boolean
     */
    boolean removeServiceProviderUser(List<Long> userId, Long serviceProviderId, String serviceProviderType);

    /**
     * 查询待同步cms
     * @return
     */
    List<ServiceProviderUserVO> listWaitCmsUserSync();
}
